package cn.edu.scau.cmi.xuchuangxiong.adapter;

import java.util.List;

public class SortAdapterOfObject implements SortTarget{
	SortUtil su =  new SortUtil();

	@Override
	public List<Integer> sortInt(List<Integer> intList) {
		return  su.sortInt(intList);
	}

	@Override
	public List<Student> sortStudent(List<Student> studentList) {
		int n = studentList.size();
		for(int i = 0; i < n-1; i++)
		{
			for(int j = 0; j < n-i-1; j++)
			{
				if(studentList.get(j).getId() > studentList.get(j+1).getId())
				{
					Student temps = studentList.get(j);
					studentList.set(j, studentList.get(j+1));
					studentList.set(j+1, temps);
				}
			}
		}
		return studentList;
	}
	
}
